package com.itheima.App;

import com.itheima.pojo.student;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Applife {
    public static void main(String[] args) {


        //此处需要使用实现类类型，接口类型没有close方法
        ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("application-life.xml");
        student bookDao = (student) ctx.getBean("student");
        bookDao.save();
        //关闭容器，执行销毁的方法
        //ctx.close();
        ctx.registerShutdownHook();


    }
}
